package StudyCode.summary.Basic.mystring;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class StringIsNullOrEmpty {

	public static void main(String[] args) {
		System.out.println(isNullOrEmptyString(" "));
		System.out.println(isNullOrEmptyString(" 1"));
		System.out.println(isNullOrEmptyString(null));
	}

	public static boolean isNullOrEmptyString(String obj) {

		if (obj == null) {
			return true;
		}

		if (obj.trim().length() == 0) {
			return true;
		}

		return (obj).isEmpty();
	}
}
